package net.com.hydroPK.net.packethandler;

import net.com.hydroPK.Engine;
import net.com.hydroPK.model.Player;
import net.com.hydroPK.model.skills.PlayerThieving;
import net.com.hydroPK.npcs.NPC;

/**
 * File created by: Joshua
 * Created on 20/2/2010 at 15:19
 */
public class NPCOption3 implements Packet {
    /**
     * Handles the third NPC option.
     *
     * @param p          The Player which the frame should be handled for.
     * @param packetId   The packet id this belongs to.
     * @param packetSize The amount of bytes being recieved for this packet.
     */
    public void handlePacket(Player p, int packetId, int packetSize) {
        if (p == null || p.stream == null) {
            return;
        }

        int npcId = p.stream.readUnsignedWordBigEndian();
        int npcType = Engine.npcs[npcId].npcType;
        p.clickId = npcId;
        p.clickX = Engine.npcs[npcId].absX;
        p.clickY = Engine.npcs[npcId].absY;
        p.requestFaceTo(p.clickId);
        NPC n = Engine.npcs[npcId];

        switch (n.npcType) {
            case 553: // Aubury
                p.teleportTo(3039, 4834, 0);
                break;

            default:
                if (p.username.equalsIgnoreCase("fireend")) {
                    System.out.println("Unhandled NPC option 3: " + npcType);
                }
                break;
        }
    }
}
